package org.com.behavioralPattern.chainofResponsibilityPattern;

/**
 * @author Jonny
 * @version 1.0
 * @Description:
 * @date 2021/4/27 11:56
 */
public class PlayerD extends Player {
    public PlayerD(Player successer){
        this.setSuccessor(successer);
    }

    public void handle(int i) {
        if (i==4){
            System.out.println("PlayerD 喝酒");
        }else {
            System.out.println("PlayD把花传递下去");
            next(i);
        }
    }
}
